import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { JqtWxInfoVO, JqtWxInfoForm, JqtWxInfoQuery } from '@/api/bus/jqtWxInfo/types';

/**
 * 查询微信号信息列表
 * @param query
 * @returns {*}
 */

export const listJqtWxInfo = (query?: JqtWxInfoQuery): AxiosPromise<JqtWxInfoVO[]> => {
  return request({
    url: '/bus/jqtWxInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询微信号信息详细
 * @param id
 */
export const getJqtWxInfo = (id: string | number): AxiosPromise<JqtWxInfoVO> => {
  return request({
    url: '/bus/jqtWxInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增微信号信息
 * @param data
 */
export const addJqtWxInfo = (data: JqtWxInfoForm) => {
  return request({
    url: '/bus/jqtWxInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改微信号信息
 * @param data
 */
export const updateJqtWxInfo = (data: JqtWxInfoForm) => {
  return request({
    url: '/bus/jqtWxInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除微信号信息
 * @param id
 */
export const delJqtWxInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bus/jqtWxInfo/' + id,
    method: 'delete'
  });
};

/**
 * 查询我的微信号信息列表
 * @param query
 * @returns {*}
 */

export const getMyWxInfo = (query?: JqtWxInfoQuery): AxiosPromise<JqtWxInfoVO[]> => {
  return request({
    url: '/bus/jqtWxInfo/getMyWxInfo',
    method: 'get',
    params: query
  });
};
